all: 00-thread 01-thread 02-thread 03-thread 04-join 05-join 06-join \
	07-stack 08-mutex 09-mutex 10-mutex 11-mutex 12-cond 00-prod-cons \
	01-prod-cons 02-prod-cons 03-prod-cons 04-prod-cons 05-prod-cons \
	06-prod-cons 07-prod-cons 08-prod-cons bug1 bug1fix bug2 bug2fix \
	bug3 bug3fix bug4 bug4fix bug5 bug5fix bug6 bug6fix bug7 bug7fix \
	setaffin setaffin_not

00-thread: 00-thread.c
	gcc 00-thread.c -o 00-thread -lpthread

01-thread: 01-thread.c
	gcc 01-thread.c -o 01-thread -lpthread

02-thread: 02-thread.c
	gcc 02-thread.c -o 02-thread -lpthread

03-thread: 03-thread.c
	gcc 03-thread.c -o 03-thread -lpthread

04-join: 04-join.c
	gcc 04-join.c -o 04-join -lpthread 

05-join: 05-join.c
	gcc 05-join.c -o 05-join -lpthread -lm

06-join: 06-join.c
	gcc 06-join.c -o 06-join -lpthread -lm

07-stack: 07-stack.c
	gcc 07-stack.c -o 07-stack -lpthread

08-mutex: 08-mutex.c
	cc 08-mutex.c -o 08-mutex -lpthread

09-mutex: 09-mutex.c
	cc 09-mutex.c -o 09-mutex -lpthread

10-mutex: 10-mutex.c
	cc 10-mutex.c -o 10-mutex -lpthread

11-mutex: 11-mutex.c
	cc 11-mutex.c -o 11-mutex -lpthread

12-cond: 12-cond.c
	cc 12-cond.c -o 12-cond -lpthread
	
00-prod-cons: 00-prod-cons.c
	gcc 00-prod-cons.c -lpthread -o 00-prod-cons

01-prod-cons: 01-prod-cons.c
	gcc 01-prod-cons.c -lpthread -o 01-prod-cons

02-prod-cons: 02-prod-cons.c
	gcc 02-prod-cons.c -lpthread -o 02-prod-cons

03-prod-cons: 03-prod-cons.c
	gcc 03-prod-cons.c -lpthread -o 03-prod-cons

04-prod-cons: 04-prod-cons.c
	gcc 04-prod-cons.c -lpthread -o 04-prod-cons

05-prod-cons: 05-prod-cons.c
	gcc 05-prod-cons.c -lpthread -o 05-prod-cons

06-prod-cons: 06-prod-cons.c
	gcc 06-prod-cons.c -lpthread -o 06-prod-cons

07-prod-cons: 07-prod-cons.c queue_a.c queue_a.h
	g++ 07-prod-cons.c queue_a.c -lpthread -o 07-prod-cons

08-prod-cons: 08-prod-cons.c queue_a.c queue_a.h
	g++ 08-prod-cons.c queue_a.c -lpthread -o 08-prod-cons

bug1: bug1.c 
	g++ bug1.c -lpthread -o bug1
	
bug1fix: bug1fix.c 
	g++ bug1fix.c -lpthread -o bug1fix
	
bug2: bug2.c 
	g++ bug2.c -lpthread -o bug2
	
bug2fix: bug2fix.c 
	g++ bug2fix.c -lpthread -o bug2fix
	
bug3: bug3.c 
	g++ bug3.c -lpthread -o bug3
	
bug3fix: bug3fix.c 
	g++ bug3fix.c -lpthread -o bug3fix
	
bug4: bug4.c 
	g++ bug4.c -lpthread -o bug4
	
bug4fix: bug4fix.c 
	g++ bug4fix.c -lpthread -o bug4fix
	
bug5: bug5.c 
	g++ bug5.c -lpthread -o bug5
	
bug5fix: bug5fix.c 
	g++ bug5fix.c -lpthread -o bug5fix
	
bug6: bug6.c 
	g++ bug6.c -lpthread -o bug6
	
bug6fix: bug6fix.c 
	g++ bug6fix.c -lpthread -o bug6fix
	
bug7: bug7.c 
	g++ bug7.c -lpthread -o bug7
	
bug7fix: bug7fix.c 
	g++ bug7fix.c -lpthread -o bug7fix
	
setaffin: setaffin.c 
	g++ setaffin.c -lpthread -o setaffin
	
setaffin_not: setaffin_not.c 
	g++ setaffin_not.c -lpthread -o setaffin_not
	
clean:
	rm -f ??-cond ??-mutex 0?-stack 0?-join 0?-thread pthread forks \
	00-prod-cons 01-prod-cons 02-prod-cons 03-prod-cons \
	04-prod-cons 05-prod-cons 06-prod-cons 07-prod-cons 08-prod-cons \
	Module.symvers modules.order .tmp_versions/* bug? bug?fix setaffin \
	setaffin_not
